package com.xunwulian.dubbo.service.impl;

import com.xunwulian.base.dao.TransactionDao;
import com.xunwulian.base.entity.TransactionEntity;
import com.xunwulian.api.iface.TransactionAPI;
import org.springframework.beans.factory.annotation.Autowired;
import com.alibaba.dubbo.config.annotation.Service;

/**
 * Created by Administrator on 2017/3/10.
 */
@Service
public class TransactionImpl implements TransactionAPI {

    @Autowired
    private TransactionDao transactionDao;

    public TransactionImpl() {
    }

    @Override
    public Integer createTransaction(TransactionEntity transactionEntity) {
        return transactionDao.insert(transactionEntity);
    }

    @Override
    public boolean updateRecordp(String recordm, String recordp) {
        transactionDao.updateRecordp(recordm, recordp);
        return true;
    }

    @Override
    public boolean updateTransStatus(String recordm, int isPay) {
        transactionDao.updateTransStatus(recordm, isPay);
        return true;
    }

    @Override
    public TransactionEntity findByRecordm(String recordm) {
        TransactionEntity transactionEntity = transactionDao.loadByRecordm(recordm);
        return transactionEntity;
    }
}
